# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=virt-viewer
pkgver=11.0
pkgrel=2
pkgdesc="A lightweight interface for interacting with the graphical display of virtualized guest OS"
url="https://virt-manager.org"
arch="all !s390x !riscv64" # spice-gtk
license="GPL-2.0-or-later"
options="!check"
makedepends="
	glib-dev
	gtk+3.0-dev
	gtk-vnc-dev
	meson
	perl
	spice-gtk-dev
	spice-protocol
	"
subpackages="$pkgname-lang $pkgname-doc"
source="https://releases.pagure.org/virt-viewer/virt-viewer-$pkgver.tar.xz
	meson-0.60-merge_file.patch
	"

case "$CARCH" in
	ppc64le|s390x|riscv64) ;;
	*) makedepends="$makedepends libvirt-dev libvirt-glib-dev"
	   ;;
esac

build() {
	abuild-meson \
		-Dvnc=enabled \
		-Dspice=enabled \
		output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
738034e15e40a7aaadd2646bf289c12409cbf2d06925d43baa50fa7bc8438188480d6b97687e9816427ac0a9dae84d205351715cb2f38afdbefa2dd1d134904a  virt-viewer-11.0.tar.xz
b956ebcf7b2860e078467ae92ec94b7d9cf34168382ba3a17d03a65864d3bc7fa0fca118c097ea8c7a1577aad258ace1b2930c384dc440eea4ae8ca51b768f09  meson-0.60-merge_file.patch
"
